<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Sitemap extends Controller{
	var $title='sitemap';
	var $view='sitemap';
	var $table='admin_act';
	
	function Sitemap(){
		parent::Controller();	
		$this->load->model("dataset_atom","my_model");
		$this->my_model->table_name($this->table);
	}
	
	function index(){
		include_once 'inc/Init.php';
		$this->load->library('pager');
		$this->load->database();
		$where=array('parent_id'=>0,'is_front_show'=>1,'id >='=>'10');
		$this->db->order_by('order_id','asc');
		$data=$this->db->get_where($this->table,$where)->result_array();
		
		foreach($data as $k=>$r)
		{
			$where=array('parent_id'=>$r['id'],'is_front_show'=>1);
			$this->db->order_by("order_id","asc");
			$data[$k]['sub']=$this->db->get_where($this->table,$where)->result_array();
		}
		$this->load->view($this->view,get_defined_vars());
	}
}